//
//  Operator.swift
//  swiftStudy
//
//  Created by unisedu on 16/4/1.
//  Copyright © 2016年 CaoFei. All rights reserved.
//

import UIKit


/**
 操作符基础
 */

class Operator: NSObject {
    
    func show(){
        //1. 与C语言不同，Swift语言的取余符号（％）允许使用浮点数
        
        let value = 30.2%3
        debugPrint(value)
        //2.多变量/常量赋值
        
        let (x,y)=(3,4)
        debugPrint(x,y)
        //3. 闭区间范围操作符
        
        for index in 1...10
        {
            print(index)
        }
        
        //4. 半开半闭范围操作符 2.0废除了
        
        let names = ["abc","ddd","xyz"]
        let count = names.count
        debugPrint(count);
        for item in names{
            print(item)
        }
        
        //for i in 0...count
        //{
        //    print(names[i])
        //    print("索引\(i)的值是\(names[i])");
        //    print(names[i])
        //}
    }
}
